﻿using System;
using System.Collections.Generic;
using System.Text;

namespace Conusic
{
    public static class RussianNumbers
    {
        public static string ReturnRightForm(int number, string karandash, string karandasha, string karandashei)
        {
            int number100 = number%100;
            int number10 = number100%10;
            if ((number100 >= 5 && number100 <= 20) || number10 >= 5 || number10 == 0)
                return karandashei;
            else if (number10 <= 4 && number10 >= 2)
                return karandasha;
            else if (number10 == 1)
                return karandash;

            throw new ApplicationException("Failed run ReturnRightForm");
        }
    }
}